//
//  SC_IndicatorView.m
//  SCCharts
//
//  Created by Yang on 9/16/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "SC_IndicatorView.h"


@implementation SC_IndicatorView


- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        // Initialization code
		self.backgroundColor = [UIColor clearColor];
		imageView = [[UIImageView alloc] initWithFrame:self.bounds];
		uperLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 20.0f, 80.0f, 20.0f)];
		uperLabel.font = [UIFont systemFontOfSize:12.0f];
		uperLabel.textAlignment = UITextAlignmentCenter;
		uperLabel.backgroundColor = [UIColor clearColor];
		[self addSubview:imageView];
		[self addSubview:uperLabel];
		lowerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 20.0f, 80.0f, 20.0f)];
		lowerLabel.font = [UIFont boldSystemFontOfSize:14.0f];
		lowerLabel.textAlignment = UITextAlignmentCenter;
		lowerLabel.backgroundColor = [UIColor clearColor];
		[self addSubview:lowerLabel];
		
    }
    return self;
}
- (void)setUpLable:(NSString *)upString lowerLabel:(NSString *)lowerString isUp:(BOOL)up {
	UIImage *image;
	if (up) {
		uperLabel.frame = CGRectMake(0.0f, 8.0f, 80.0f, 20.0f);
		lowerLabel.frame = CGRectMake(0.0f, 22.0f, 80.0f, 20.0f);
		image = [UIImage imageNamedTK:@"SCCharts.bundle/Images/popdown"];
		//imageName = [[NSBundle mainBundle] pathForResource:@"popup.png" ofType:nil];
		//imageName = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"SCCharts.bundle/Images/popup.png"];
	}
	else {
		uperLabel.frame = CGRectMake(0.0f, -2.0f, 80.0f, 20.0f);
		lowerLabel.frame = CGRectMake(0.0f, 13.0f, 80.0f, 20.0f);
		image = [UIImage imageNamedTK:@"SCCharts.bundle/Images/popup"];
		//imageName = [[NSBundle mainBundle] pathForResource:@"popdown.png" ofType:nil];
		//imageName = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"SCCharts.bundle/Images/popdown.png"];

	}
	uperLabel.text = upString;
	lowerLabel.text = lowerString;
	imageView.image = image;//[UIImage imageNamed:imageName];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc {
    [super dealloc];
}


@end
